<%--
  Created by IntelliJ IDEA.
  User: 86187
  Date: 2021/10/21
  Time: 10:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="resource/bootstrap4/css/bootstrap.css">
    <script src="resource/js/jquery-3.2.1.js"></script>
    <script src="resource/bootstrap-treeview/js/bootstrap-treeview.js"></script>
    <script src="resource/bootstrap4/js/bootstrap.js"></script>
    <script src="resource/My97DatePicker/WdatePicker.js"></script>
    <title>列表</title>
<script>
    function goPage(pageNum){
        $("#nav-tabContent").load("list?pageNum="+pageNum+"&"+$("#f1").serialize());
    }

    function px1(pageNum){
        $("[name='flag']").val("");
        var order1 = $("[name='orderName']").val();
        var msg = "";
        if(order1==""){
            msg = "asc";
        }
        if(order1=="asc"){
            msg = "desc";
        }
        if(order1=="desc"){
            msg = "asc";
        }
        $("[name='orderName']").val(msg);
        goPage(pageNum);
    }

    function px2(pageNum){
        $("[name='orderName']").val("");
        var order1 = $("[name='flag']").val();
        var msg = "";
        if(order1==""){
            msg = "asc";
        }
        if(order1=="asc"){
            msg = "desc";
        }
        if(order1=="desc"){
            msg = "asc";
        }
        $("[name='flag']").val(msg);
        goPage(pageNum);
    }

    function toAdd(){
        $("#nav-tabContent").load("toAdd");
    }
</script>
    <form:form modelAttribute="vo" action="/list" method="post" id="f1">
        出库单号:<form:input path="outNum"></form:input>
        <form:select path="rdate">
            <form:option value="">--请选择--</form:option>
            <form:option value="fh_date">出库日期</form:option>
            <form:option value="zd_date">制单时间</form:option>
        </form:select>
        <input type="date" name="time1" value="<fmt:formatDate value='${vo.time1}' pattern='yyyy-MM-dd'></fmt:formatDate>">至
        <input type="date" name="time2" value="<fmt:formatDate value='${vo.time2}' pattern='yyyy-MM-dd'></fmt:formatDate>">
        备注:<form:input path="mark"></form:input>
        <form:select path="nums">
            <form:option value="">--请选择--</form:option>
            <form:option value="kh_num">客户单号</form:option>
            <form:option value="fh_num">发货单号</form:option>
        </form:select>
        <form:input path="mohu"></form:input>
        总金额:<form:input path="m1"></form:input>至
        <form:input path="m2"></form:input>
        排序:<a href="javascript:px1(1)">发货日期</a>
        <input type="hidden" name="orderName" value="${vo.orderName}">
        <a href="javascript:px2(1)">总金额</a>
        <input type="hidden" name="flag" value="${vo.flag}">
        <input type="button" onclick="goPage(1)" value="查询">
        <input type="button" onchange="toAdd()" value="新增出库单">
    </form:form>
    <table class="table">
        <tr align="center">
            <td>序号</td>
            <td>出库日期</td>
            <td>出库单号</td>
            <td>总金额</td>
            <td>制单人工号</td>
            <td>制单人</td>
            <td>制单时间</td>
            <td>客户单号列表</td>
            <td>发货单号列表</td>
            <td>附件</td>
            <td>备注</td>
        </tr>
        <c:forEach items="${info.list}" var="a" varStatus="i">
            <tr align="center">
                <td>${i.index+1}</td>
                <td>
                    <fmt:formatDate value="${a.fhDate}" pattern="yyyy-MM-dd"></fmt:formatDate>
                </td>
                <td>${a.outNum}</td>
                <td>${a.outMoney}</td>
                <td>${a.zdNum}</td>
                <td>${a.zdName}</td>
                <td>
                    <fmt:formatDate value="${a.zdDate}" pattern="yyyy-MM-dd"></fmt:formatDate>
                </td>
                <td>${a.khNum}</td>
                <td>${a.fhNum}</td>
                <td>
                    <c:forTokens items="${a.fhFile}" delims="," var="pic">
                        <img src="${pic}" width="120px" height="120px">
                    </c:forTokens>
                </td>
                <td>${a.mark}</td>
            </tr>
        </c:forEach>
    </table>
    <jsp:include page="/resource/common/pages.jsp"></jsp:include>
</head>
<body>


</body>
</html>